Computer-assisted hair coloring guidance may be used, for example, to give a user a visual impression of how he/she would look with a selected desired hair color. For example, in a digital image of the user in which the user's hair, among other things, is visible, a region of the image may be determined in which hair is depicted. This hair region may be recolored in the desired hair color.
Some conventional programs determine the hair region of a digital image, for example, by determining a frequency distribution of color values of individual pixels of the digital image. A subgroup of the pixels, for example a group of pixels which lie in a color space close to a color value of a hair color that is manually preselected, for example, may be associated with the hair region.
Other conventional programs may utilize a hair structure, for example a spatial proximity and/or a linear course of pixels of the same or similar color, in order to identify the hair region, for example in particular portions of the hair that are not depicted as a closed surface, such as hair strands. Other conventional programs may combine color information and structure information.
However, in determining the region in which hair is depicted, all hair may not be identified as such (this may also be referred to as under-detection), and/or regions in which no hair is depicted may be associated with the hair region (this may also be referred to as over-detection).
Hair, for example hair having a natural color, may typically have a plurality of shades, not just one shade. For example, an uppermost hair layer or a hair region at the tips of the hair may have a different shade than a main part of the hair, for example because the hair is lightened by solar radiation. Alternatively or additionally, the hair at the scalp may have a different shade than the main part of the hair, for example because the hair has just grown out of the scalp and has been exposed to solar radiation for the least amount of time. These various shades may correspond to regions in the color space that are so far apart from one another that not all of them are identified as shades of hair by a conventional program, and therefore not all regions in which hair is depicted are marked as such.
To avoid such a case of under-detection, a selection area around a shade known as a hair shade may be determined, within which a pixel is associated with the hair region (a so-called selection radius may be associated with the selection area for the case of a distance from the hair shade that is the same in all directions). The selection area may be made large enough that essentially any portion of the image on which hair is depicted is determined to be hair. As a result, however, an area of the image having a shade that is within the selection area but which does not depict hair, for example an area in which skin or clothing is visible, may be associated with the hair region.
In conventional hair coloring guidance programs, a uniform shade, which may correspond to the desired hair color, for example, may be used to recolor an area of the photograph that is determined to be a hair region. As a result, however, the photograph may look unnatural with the recolored hair region, for example due to the new hair color having only one shade. Dyeing the hair may thus be perceived as undesirable.
If a photograph with a recolored hair region had a natural appearance, willingness to dye the hair could thus be increased.